<template>
  <view class="container font-B">
    <view class="container-item c-b-fff jh-space-between jh-align-center">
      <view class="font-34 c-000">擅长及诊所介绍</view>
      <view class="jh-align-center">
        <view class="font-34 c-999"></view>
        <image class="margin-l30" style="width: 6px;height: 22rpx;display: block;" :src="ossDomain + '/rightArrow2.png'"></image>
      </view>
    </view>
    <view class="container-item c-b-fff jh-space-between jh-align-center">
      <view class="font-34 c-000">教育背景</view>
      <view class="jh-align-center">
        <view class="font-34 c-999">{{info.educational_background}}</view>
        <image class="margin-l30" style="width: 6px;height: 22rpx;display: block;" :src="ossDomain + '/rightArrow2.png'"></image>
      </view>
    </view>
    <view class="container-item c-b-fff jh-space-between jh-align-center">
      <view class="font-34 c-000">寄语</view>
      <view class="jh-align-center">
        <view class="font-34 c-999"></view>
        <image class="margin-l30" style="width: 6px;height: 22rpx;display: block;" :src="ossDomain + '/rightArrow2.png'"></image>
      </view>
    </view>
  </view>
</template>

<script>
  import {
    mapState
  } from 'vuex'

  export default {
    data() {
      return {
        ossDomain: uni.ossDomain,
        info: {}
      }
    },
    computed: {
      ...mapState({
        userInfo: state => state.user.userInfo
      })
    },
    onShow() {
      this.getInfo()
      this.info = this.userInfo.user
    },
    methods: {
      getInfo () {
        this.$http.getInfo().then(res => {
          this.info = res.data[0]
          this.userInfo.user = Object.assign(this.userInfo.user,this.info)
          this.$store.commit('setUserInfo', this.userInfo);
          this.info = this.userInfo.user
          console.log(this.info);
        })
      },
      open(url) {
        uni.navigateTo({
          url: url
        });
      },
      logout() {
        this.$store.dispatch('resetStore')
        uni.$app.logout()
        wx.hideLoading()
        wx.reLaunch({
          url: '../login/main'
        })
      }
    }
  }
</script>

<style lang='scss' scoped>
  .container {
    background-color: #F8F8F8;
    height: 100vh;
    &-item{
      height: 110rpx;
      padding: 0 32rpx;
      border-bottom: 1px solid #ddd;
    }
  }
</style>
